﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace Forbidden_Island
{
    public partial class OrderOfPlay : Forbidden_Island.BaseHelpMenu
    {
        int phase = 0;
        public OrderOfPlay()
        {
            InitializeComponent();
        }

        private void OrderOfPlay_Load(object sender, EventArgs e)
        {
            showPhase0();
            setTitle("Order of Play, Phase One - Actions Phase");
        }

        private void btnNext_Click(object sender, EventArgs e)
        {
            phase++;
            if (phase == 1)
            {
                btnNext.Visible = true;
                btnPrevious.Visible = true;
                btnPrevious.Text = "<<-- Phase 1, Actions";
                btnNext.Text = "Phase 2, Part Two -->>";
                showPhase1();
            }
            else if (phase == 2)
            {
                btnPrevious.Text = "<<-- Phase 2, Part One";
                btnNext.Text = "Phase 3, Island Floods -->>";
                btnPrevious.Visible = true;
                btnNext.Visible = true;
                showPhase2();
            }
            else if (phase == 3)
            {
                btnPrevious.Text = "<<--Phase 2, Part Two";
                btnNext.Text = "Taking Actions -->";
                btnPrevious.Visible = true;
                btnNext.Visible = true;
                showPhase3();
            }
            else if (phase == 4)
            {
                this.Close();
                Taking_Actions ta = new Taking_Actions();
                ta.StartPosition = FormStartPosition.Manual;
                ta.Location = new Point(213, 213);
                ta.Activate();
                ta.Visible = true;
            }
        }

        private void btnPrevious_Click(object sender, EventArgs e)
        {
            phase--;
            if (phase == -1)
            {
                this.Close();
                ObjectOfGame oog = new ObjectOfGame();
                oog.StartPosition = FormStartPosition.Manual;
                oog.Location = new Point(213, 213);
                oog.Activate();
                oog.Visible = true;
            }

            if (phase == 0)
            {
                btnPrevious.Text = "<<-- Object of Game";
                btnPrevious.Visible = true;
                btnNext.Visible = true;
                btnNext.Text = "Phase 2, Draw Cards -->>";
                showPhase0();
            }
            else if (phase == 1)
            {
                btnNext.Visible = true;
                btnPrevious.Visible = true;
                btnPrevious.Text = "<<-- Phase 1 - Actions";
                btnNext.Text = "Phase 2, Part Two -->>";
                showPhase1();
            }
            else if (phase == 2)
            {
                btnNext.Visible = true;
                btnPrevious.Visible = true;
                btnPrevious.Text = "<<-- Phase 2, Part One";
                btnNext.Text = "Phase 3, Island Floods -->>";
                showPhase1();
            }
        }
        public void showPhase0()
        {
            setTitle("Order of Play, Phase One - Action Phase");
            setLabelText("The game is played in three phases:\n\n" + "Phase One: Player Action Phase\n\n" +
                "   During the player action phase, players can take up to 3 actions.  These actions may consist of: \n\n" +
                "   »Move.  Player can move one space per action.\n" +
                "   »Shore up a tile.  All players may shore up any immediately adjacent tile or the tile they are on.\n" +
                "   »Trade.  Players can give one card to another player if both of your tokens are on the same tile.\n\n" +
                "   Each of the above actions cost one action each.\n\n" +
                "   Note: The special cards sandbags and helicopter lift can be played at any time, even on another \n" +
                "      player's turn!  They cost no actions to play.");
        }
        public void showPhase1()
        {
            setTitle("Order of Play, Phase Two - Draw Phase");
            setLabelText("Phase Two: Player Draw Phase\n\n" +
                "   During the player draw phase, players automatically draw 2 cards.  The types of cards you can draw\n" +
                "      include treasure cards, special cards, and waters rise.\n\n" +
                "   1)Treasure cards: Collect four of these cards and move to the correct tile to claim a treasure!\n\n" +
                "     Treasure name and claim tiles are:\n" +
                "         »Water Chalice: Can be claimed at the Serpent's Palace or the Sea King's Palace.\n" +
                "             These tiles have green text.\n" +
                "         »Wind Carving: Can be claimed at the Garden of Lupus or the Garden of Disquiet.\n" +
                "             These tiles have magenta text.\n" +
                "         »Dragon Totem: Can be claimed at the Cultist's Cave or the Reptile's cave. \n" +
                "             These tiles have red text.\n" +
                "         »Earth Statue: Can be claimed at the Temple of Ra tile or the Temple of Luna.\n" + 
                "             These tiles have black text.\n\n" +
                "   2)Special Action cards: \n" + 
                "         »Sandbags allow players to shore up any tile on the island!  \n" +
                "            Just click the sandbag card, then click a flooded tile.\n" +
                "         »Helicopter lifts may be fly any number of players on a single tile to any other tile on the island.\n" +
                "            Click the card and follow the on-screen instructions to use a helicopter lift.\n\n" +
                "     Neither of the special action cards take an action to play, and may be played at any time.");
        }
        public void showPhase2()
        {
            setTitle("Order of Play, Phase Two - Draw Phase, continued");
            setLabelText("Phase Two, continued\n\n" + 
                "   3) Waters Rise! card: When this card is drawn, the player does not take a card and instead the \n"+
                "      following occurs:\n\n" +
                "     a) The water level rises.  As the water level rises, more cards are drawn during the flood phase.\n" +
                "     b) The places discard deck is shuffled and placed ON TOP of the places draw deck.\n" +
                "     c) The Waters Rise! card is placed in the discard pile.\n\n" +
                "     Managing Waters Rise! is one of the keys to doing well at Isle of Foreboding.\n");
        }

        public void showPhase3()
        {
            setTitle("Order of Play, Phase Three - Flood Phase");
            setLabelText("Phase Three - Flood Phase\n\n" +
                "   During the flood phase, cards are drawn from the places deck one at a time.\n\n" +
                "   The number of cards drawn is based on the current flood level, as shown next to the water level\n" +
                "      meter to the left.\n\n" +
                "   When a card is drawn, if the corresponding tile for that card is dry, it becomes flooded.\n" +
                "      Players can safely occupy tiles that are flooded.\n\n" +
                "   If that tile is already flooded, then the tile sinks and is removed from the game.\n\n" +
                "   Players can no longer use sunken tiles to move around the board, nor can they use sunken\n" +
                "      treasure claim tiles.\n\n" +
                "   Anticipating which tiles may be drawn during the flood phase is one of the keys to success.");
        }
    }
}
